import { defHttp } from '/@/utils/http/axios';
enum Api {
  list="/actBusiness/listData",
  getProcessDataList= "/activiti_process/listData",
  delByIds='/actBusiness/delByIds',
  getFirstNode='/actProcessIns/getFirstNode',
  applyBusiness='/actBusiness/apply',
  cancelApply='/actBusiness/cancel',
  getForm='/actBusiness/getForm',
  addApply='/actBusiness/add',
  editForm='/actBusiness/editForm',
  historicFlow='/actTask/historicFlow/',
}

export const addApply = (params) => defHttp.post(
  { url: Api.addApply,
    data: params,
    headers:{'Content-Type':'application/x-www-form-urlencoded'}
  }
  );
  export const cancelApply = (params) =>{ 
    defHttp.post({ url: Api.cancelApply,
      data: params,
      headers:{'Content-Type':'application/x-www-form-urlencoded'}
    }) 
  };
/**
 * 字典列表接口
 * @param params
 */
export const list = (params) => defHttp.get({ url: Api.list, params });

export const getProcessDataList = (params) => defHttp.get({ url: Api.getProcessDataList, params });

export const getFirstNode = (params) => defHttp.get({ url: Api.getFirstNode, params });

export const applyBusiness = (params) => defHttp.post({ url: Api.applyBusiness, params });
export const historicFlow = (params) => defHttp.get({ url: Api.historicFlow+params.procInstId});



/**
 * 删除字典
 */
export const delByIds = (params, handleSuccess) => {
  return defHttp.post({ url: Api.delByIds, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};
/**
 * 批量删除字典
 * @param params
 */
// export const batchDeleteDict = (params, handleSuccess) => {
//   Modal.confirm({
//     title: '确认删除',
//     content: '是否删除选中数据',
//     okText: '确认',
//     cancelText: '取消',
//     onOk: () => {
//       return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
//         handleSuccess();
//       });
//     },
//   });
// };
